package cn.sxgan.common.config.properties;


import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @Description: 系统自定义全局属性配置
 * @Author: sxgan
 * @Date: 2024-09-18 10:27
 * @Version: 1.0
 **/
@Component
@ConfigurationProperties(prefix = "zoey")
public class ZoeyConfig {
    /**
     * 项目名称
     */
    private static String name;
    
    /**
     * 版本
     */
    private static String version;
    
    /**
     * 版权年份
     */
    private static String copyrightYear;
    
    /**
     * 实例演示开关
     */
    private static boolean demoEnabled;
    
    /**
     * 上传路径
     */
    private static String profile;
    
    /**
     * 令牌密钥
     */
    private static String tokenKey;
    
    /**
     * 获取地址开关
     */
    private static boolean addressEnabled;
    /**
     * 开发者token
     */
    private static String adminToken;
    
    
    private static String secretKey;
    
    public static String getName() {
        return name;
    }
    
    public void setName(String name) {
        ZoeyConfig.name = name;
    }
    
    public static String getVersion() {
        return version;
    }
    
    public void setVersion(String version) {
        ZoeyConfig.version = version;
    }
    
    public static String getCopyrightYear() {
        return copyrightYear;
    }
    
    public void setCopyrightYear(String copyrightYear) {
        ZoeyConfig.copyrightYear = copyrightYear;
    }
    
    public static boolean isDemoEnabled() {
        return demoEnabled;
    }
    
    public void setDemoEnabled(boolean demoEnabled) {
        ZoeyConfig.demoEnabled = demoEnabled;
    }
    
    public static String getProfile() {
        return profile;
    }
    
    public void setProfile(String profile) {
        ZoeyConfig.profile = profile;
    }
    
    public static boolean isAddressEnabled() {
        return addressEnabled;
    }
    
    public void setAddressEnabled(boolean addressEnabled) {
        ZoeyConfig.addressEnabled = addressEnabled;
    }
    
    public static String getSecretKey() {
        return secretKey;
    }
    
    public static void setSecretKey(String secretKey) {
        ZoeyConfig.secretKey = secretKey;
    }
    
    public static String getTokenKey() {
        return tokenKey;
    }
    
    public void setTokenKey(String tokenKey) {
        ZoeyConfig.tokenKey = tokenKey;
    }
    
    public static String getAdminToken() {
        return adminToken;
    }
    
    public void setAdminToken(String adminToken) {
        ZoeyConfig.adminToken = adminToken;
    }
    
    /**
     * 获取导入上传路径
     */
    public static String getImportPath() {
        return getProfile() + "/import";
    }
    
    /**
     * 获取头像上传路径
     */
    public static String getAvatarPath() {
        return getProfile() + "/avatar";
    }
    
    /**
     * 获取下载路径
     */
    public static String getDownloadPath() {
        return getProfile() + "/download/";
    }
    
    /**
     * 获取上传路径
     */
    public static String getUploadPath() {
        return getProfile() + "/upload";
    }
}
